﻿using Core.Domain.Bases;

namespace Core.Domain.Interfaces

{
  ///<summary>Base repository interface</summary>
  ///<typeparam name="T"></typeparam>
  public interface IRepository<T> where T : EntityBase
  {
    ///<summary>Get by Id</summary>
    ///<param name="id"></param>
    ///<returns></returns>
    T Get(int id);

    ///<summary>Save this entity</summary>
    ///<param name="entity"></param>
    void Save(T entity);

    ///<summary>Add to repository</summary>
    ///<param name="entity"></param>
    void Add(T entity);

    ///<summary>Remove from the repository</summary>
    ///<param name="entity"></param>
    void Remove(T entity);
  }
}